package artid.com.arttogoa.parser;

import java.io.Serializable;
import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONObject;

public class RecordDetailList extends AppItem implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	String id;
	String type;
	String title;
	String art_type;
	String realname;
	String age;
	String detail;
	String artimgurl;
	String artandauthorphotourl;
	String imgurl;
	String text;
	String date;
	String code;
	String issue_date;
	String certificateurl;
	String reason;
	String inscribeimgurl;
	String width;
	String height;
	String comImageUrl;
	ArrayList<Pointinformation> pointinformation;

	
	public String getComImageUrl() {
		return comImageUrl;
	}

	public void setComImageUrl(String comImageUrl) {
		this.comImageUrl = comImageUrl;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public static class Pointinformation implements Serializable {
		/**
		 * TODO<请描述这个方法是干什么的>
		 * 
		 * @throw
		 * @return
		 */
		private static final long serialVersionUID = 1L;
		private int index;
		private String imgurl;
		private String imgurlone;
		private String imgUrlSixty;
		private String text;
		private String x;
		private String y;

		public String getImgUrlSixty() {
			return imgUrlSixty;
		}

		public void setImgUrlSixty(String imgUrlSixty) {
			this.imgUrlSixty = imgUrlSixty;
		}


		@Override
		public String toString() {
			return "Pointinformation [index=" + index + ", imgurl=" + imgurl
					+ ", imgurlone=" + imgurlone + ", imgUrlSixty="
					+ imgUrlSixty + ", text=" + text + ", x=" + x + ", y=" + y
					+ "]";
		}

		public int getIndex() {
			return index;
		}

		public void setIndex(int index) {
			this.index = index;
		}

		public String getImgurl() {
			return imgurl;
		}

		public void setImgurl(String imgurl) {
			this.imgurl = imgurl;
		}

		public String getText() {
			return text;
		}

		public void setText(String text) {
			this.text = text;
		}

		public String getX() {
			return x;
		}

		public void setX(String x) {
			this.x = x;
		}

		public String getY() {
			return y;
		}

		public void setY(String y) {
			this.y = y;
		}

		public String getImgurlone() {
			return imgurlone;
		}

		public void setImgurlone(String imgurlone) {
			this.imgurlone = imgurlone;
		}
	}

	public String getInscribeimgurl() {
		return inscribeimgurl;
	}

	public void setInscribeimgurl(String inscribeimgurl) {
		this.inscribeimgurl = inscribeimgurl;
	}

	public ArrayList<Pointinformation> getPointinformation() {
		return pointinformation;
	}

	public void setPointinformation(ArrayList<Pointinformation> pointinformation) {
		this.pointinformation = pointinformation;
	}

	@Override
	public void parse(JSONObject obj) {
		if (null == obj) {
			return;
		}
		type = obj.optString("type");
		title = obj.optString("title");
		art_type = obj.optString("art_type");
		realname = obj.optString("realname");
		width = obj.optString("width");
		height = obj.optString("height");
		age = obj.optString("age");
		detail = obj.optString("detail");
		artimgurl = obj.optString("artimgurl");
		inscribeimgurl = obj.optString("inscribeimgurl");
		artandauthorphotourl = obj.optString("artandauthorphotourl");
		imgurl = obj.optString("imgurl");
		text = obj.optString("text");
		date = obj.optString("date");
		code = obj.optString("code");
		issue_date = obj.optString("issue_date");
		certificateurl = obj.optString("certificateurl");
		reason = obj.optString("reason");
		pointinformation = new ArrayList<Pointinformation>();
		JSONArray arr = obj.optJSONArray("pointinformation");
		if (arr != null) {
			System.out.println(arr.toString());
			for (int i = 0; i < arr.length(); i++) {
				Pointinformation p = new Pointinformation();
				p.index = i;
				p.imgurl = arr.optJSONObject(i).optString("imgurl");
				p.imgUrlSixty = arr.optJSONObject(i).optString("imgUrlSixty");
				p.imgurlone = arr.optJSONObject(i).optString("imgurlone");
				p.text = arr.optJSONObject(i).optString("text");
				p.x = arr.optJSONObject(i).optDouble("x") + "";
				p.y = arr.optJSONObject(i).optDouble("y") + "";
				pointinformation.add(p);
			}
		}
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getArt_type() {
		return art_type;
	}

	public void setArt_type(String art_type) {
		this.art_type = art_type;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getAge() {
		return age;
	}

	public void setAge(String age) {
		this.age = age;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	public String getArtimgurl() {
		return artimgurl;
	}

	public void setArtimgurl(String artimgurl) {
		this.artimgurl = artimgurl;
	}

	public String getArtandauthorphotourl() {
		return artandauthorphotourl;
	}

	public void setArtandauthorphotourl(String artandauthorphotourl) {
		this.artandauthorphotourl = artandauthorphotourl;
	}

	public String getImgurl() {
		return imgurl;
	}

	public void setImgurl(String imgurl) {
		this.imgurl = imgurl;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getIssue_date() {
		return issue_date;
	}

	public void setIssue_date(String issue_date) {
		this.issue_date = issue_date;
	}

	public String getCertificateurl() {
		return certificateurl;
	}

	public void setCertificateurl(String certificateurl) {
		this.certificateurl = certificateurl;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public String getHeight() {
		return height;
	}

	public void setHeight(String height) {
		this.height = height;
	}

	@Override
	public String toString() {
		return "RecordDetailList [id=" + id + ", type=" + type + ", title="
				+ title + ", art_type=" + art_type + ", realname=" + realname
				+ ", age=" + age + ", detail=" + detail + ", artimgurl="
				+ artimgurl + ", artandauthorphotourl=" + artandauthorphotourl
				+ ", imgurl=" + imgurl + ", text=" + text + ", date=" + date
				+ ", code=" + code + ", issue_date=" + issue_date
				+ ", certificateurl=" + certificateurl + ", reason=" + reason
				+ ", inscribeimgurl=" + inscribeimgurl + ", width=" + width
				+ ", height=" + height + ", comImageUrl=" + comImageUrl
				+ ", pointinformation=" + pointinformation + "]";
	}


}
